from app.services.business.gaolu_diagnose.ind.abstract_ind import AbstractInd


class CG_LT_GL_GL04_FCokeRate(AbstractInd):

    def get_name(self):
        return "CG_LT_GL_GL04_FCokeRate"

    def get_data_source(self):
        return "mysql"

    def get_sql(self, params):

        sql = """
        SELECT
        round(AVG(fcokerate),0) as  CG_LT_GL_GL04_FCokeRate
        FROM syn_tq_rshangliaoqk
        WHERE fdatetime > DATE_SUB(CURTIME(), INTERVAL 1 hour)
        """.format(**params)
        return sql